import { T_srv, Tsrv, ifs, ts, tvs, vue } from '@/services';
import { I_cmd, T_cmd } from './command';
import { N_HistoricalCurve } from './type';

const treeConfig = () => {
  return {
    name: '',
    comment: '',
    isCreated: false,
    status: '',
    dbType: 'mysql',
    tableStyle: {
      showHeader: true,
      showFooter: false,
      showToolbar: true,
      border: true,
      mode: 'nav'
    },
    tableColumns: [],
    uniqueIndexes: [],
    indexes: [],
    rules: [],
    toolbar: {
      default: true,
      expandAll: true,
      contractAll: true,
      mutiSelect: true,
      addon: []
    },
    tableDataSetting: { editable: true },
    tableDataSource: {
      main: {
        name: 'historical_curve_setting',
        fields: [
          {
            field: 'f_name',
            keyField: true,
            childField: false,
            isShow: true,
            filter: ''
          },
          {
            field: '_da_ecbox_id',
            keyField: false,
            childField: false,
            isShow: false,
            filter: ''
          },
          {
            field: 'conversion_rate',
            keyField: false,
            childField: true,
            isShow: false,
            filter: ''
          }
        ],
        id: '609228399450058752'
      }
    },
    messageConfig: {
      custDefListener: { coordination: '114F3B9E09267696' },
      emitActions: {
        search: [
          {
            toID: 'D4758D0A1EE3A41C',
            msg: {
              type: 'search',
              content: { ikey: 'f_name', ukey: 'f_name', val: '' }
            },
            sourceToID: 'historical_curve_setting'
          }
        ],
        refresh: []
      },
      eventGroup: {
        '': {
          custDefListener: { coordination: '114F3B9E09267696' },
          children: [
            {
              // eslint-disable-next-line camelcase
              historical_curve_setting: {
                custDefListener: { coordination: '05BFC2E56CC0D26C' },
                children: []
              }
            }
          ]
        }
      }
    }
  };
};

export {
  I_cmd,
  N_HistoricalCurve,
  T_cmd,
  T_srv,
  Tsrv,
  ifs,
  treeConfig,
  ts,
  tvs,
  vue
};
